package com.bruce.demo2.patterns.demo1.creational.demo03.abstractFactory;

/**
 * @PROJECT_NAME design_patterns
 * @DESCRIPTION 测试类
 * @AUTHOR CNBruceLee
 * @DATE 2021/7/11 14:52
 */
public class Test {
    @org.junit.Test
    public void test() {
        FoodFactory factory1 = new AmericanFlavorFactory();
        Coffee coffee1 = factory1.createCoffee();
        System.out.println(coffee1.getName());
        factory1.createDessert();

        System.out.println("=======================");
        FoodFactory factory2 = new ItalyFlavorFactory();
        Coffee coffee2 = factory2.createCoffee();
        System.out.println(coffee2.getName());
        factory2.createDessert();
    }
}
